<include file="./Admin/Tpl/Index/header.html"/>			

<include file="./Admin/Tpl/Index/left.html"/>	


	<div class="diywap_right">

		<div class="well well-sm">添加门店</div>


<script>
			$(function(){
				$('#save').click(function(){
					$shopcode = $('#shopcode');
					$shopname = $('#shopname');
					$shopcode.val($.trim($shopcode.val()));
					$shopname.val($.trim($shopname.val()));
					if (!$shopcode.val()) {
						alert('请输入门店码！');
						$shopcode.focus();
						return false;
					}
					
					if (!$shopname.val()) {
						alert('请输入门店名称！');
						$shopname.focus();
						return false;
					}
					
					$('form[name="myForm"]').submit();
				});
			});
			
			
			function repeatCheck() {
				$shopcode = $('#shopcode');
				$shopcode.val($.trim($shopcode.val()));
				if (!$shopcode.val()) {
					return false;
				}
				
				$.ajax({
					url : "__APP__/Shop/repeatCheck",
					data : {"shopcode":$shopcode.val()},
					dataType : "json",
					type : "post",
					success : function(data) {
						//alert(data.msg);
						if (data.status == 'ok') {
							
						} else {
							alert(data.msg);
							$shopcode.focus();
						}
						
						
					}
					
				});
				
				
			}
		</script>
<form class="form-horizontal" action='__APP__/Shop/doAdd' method="post" name="myForm" />
			
			<div class="form-group">

			 <label for="pwd" class="col-sm-2 control-label">门店码:</label>

				 <div class="col-sm-4">

					<input type="text" name="shopcode" id="shopcode" class="form-control" onblur="repeatCheck()" >

				 </div>

			</div>
			
			<div class="form-group">

			 <label for="catename" class="col-sm-2 control-label">门店名称:</label>

				 <div class="col-sm-4">

					<input type="text" name="shopname" id="shopname" class="form-control" />

				 </div>

			</div>
			
			
			<button type="submit" class="btn btn-primary btn-lg" id="save">保 存</button>

			</form>

			</div>

			</div>
	</div>

</body>

</html>